package com.pagoda.viewfinder

import android.os.Bundle
import android.view.View
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.pagoda.viewfinder_annotation.BindClick
import com.pagoda.viewfinder_annotation.BindView
import com.pagoda.viewfinder_bridge.ViewFinder

class MainActivity : AppCompatActivity() {

    @BindView(R.id.txt_hello)
    lateinit var helloTxt: TextView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        ViewFinder.inject(this)
    }


    @BindClick(value = [R.id.btn_hello])
    fun changeText(view: View) {
        helloTxt.text = "点击后的数据！"
    }

    override fun onDestroy() {
        super.onDestroy()
        ViewFinder.unbind(this)
    }
}